{include file="index/header"}
<body>
<div class="fly-panel fly-panel-user">
    <div class="tpt-admin">
        <fieldset class="layui-elem-field layui-field-title">
            <legend>订单入库</legend>
        </fieldset>
        <form class="layui-form">
            <div class="layui-form-item">
                <label class="layui-form-label">开始时间</label>
                <div class="layui-input-inline">
                    <input type="text" name="start_time" id="start_time" required placeholder="yyyy-mm-dd" autocomplete="off" class="layui-input" onclick="layui.laydate({elem: this})">
                </div>
                <em>订单查询开始时间</em>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">结束时间</label>
                <div class="layui-input-inline">
                    <input type="text" name="end_time" id="end_time" required placeholder="yyyy-mm-dd" autocomplete="off" class="layui-input" onclick="layui.laydate({elem: this})">
                </div>
                <em>订单查询结束时间</em>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">页数</label>
                <div class="layui-input-inline" style="width: 190px;">
                    <input type="text" name="toPage" value="1" autocomplete="off" class="layui-input">
                </div>
                <em>第几页，默认1，1~100；页数大小默认20</em>
            </div>
            <div class="layui-form-item" style="width: 300px;">
                <label class="layui-form-label">订单状态</label>
                <div class="layui-input-block">
                    <select name="payStatus">
                        <option value=" ">创建时间</option>
                        <option value="3">结算时间</option>
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit="" lay-filter="submit">立即提交</button>
                    <button class="layui-btn layui-btn-primary" onclick="history.go(-1)">返回</button>
                </div>
            </div>
        </form>
    </div>
</div>
{include file="index_footer"}
<script type="text/javascript">
    layui.use(['form', 'laydate', 'upload'],function(){
        var form = layui.form()
            ,jq = layui.jquery;

        form.on('submit(submit)', function(data){
            loading = layer.load(2, {
                shade: [0.2,'#000']
            });
            var param = data.field;
            $.ajax({
                type: 'POST',
                url : "{:url('taoorder/add')}",
                data:param,
                dataType:'json',
                success: function(data){
                    if(data.code == 200){
                        layer.close(loading);
                        layer.msg(data.msg, {icon: 1, time: 1000}, function(){
                            location.href = '{:url("taoorder/index")}';
                        });
                    }else{
                        layer.close(loading);
                        layer.msg(data.msg, {icon: 2, anim: 6, time: 1000});
                    }
                },
            });
            return false;
        });
    })
</script>
</body>
</html>